<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>我的小屋</title>
    <link rel="stylesheet" th:href="@{/layui-v2.6.4/layui/css/layui.css}" type="text/css"/>
    <link rel="stylesheet" th:href="@{/layui-v2.6.4/layui/css/modules/code.css}" type="text/css"/>
    <script th:src="@{/js/jquery-3.5.1.min.js}"></script>
    <script charset="utf-8" th:src="@{/layui-v2.6.4/layui/layui.js}" type="text/javascript"></script>
    <script>
        layui.use('element', function () {
            var element = layui.element;
        });
    </script>
    <style>
        body {
            height: 100%;
            /*background: linear-gradient(90deg, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB, #C9CACB);*/
        }
        label{
            color: #43586A;
        }
        input{
            color: black;
            background-color: white;
        }
    </style>
</head>
<body>
<div class="layui-fluid" style="height: 500px;">
    <div class="layui-row" style=" width: 100%;height: 100%; ">
<!--        <div class="layui-col-md12" style="text-align: center; margin: auto;font-size: 20px">
            <b>修改信息</b>
            <div style="width: 100%;height: 1px
            ;background:#E0E0E0;"></div>
        </div>-->
<!--        <div class="layui-col-md12 layui-row">
            <div class="layui-col-md2" style="font-size: 16px;font-weight: 600;color: #222226;">基本信息</div>
        </div>-->
        <div class="layui-col-md10 layui-col-lg10 layui-col-sm10 layui-col-xs10 layui-row" style="height: 5px;"></div>
        <div class="layui-col-md12 layui-col-lg12 layui-col-sm12 layui-col-xs12 layui-row"style="height:1px; background:#E0E0E0;"></div>
        <br><br>
        <div class="layui-col-md9 layui-col-lg9 layui-col-sm9 layui-col-xs9">
            <form  id="form" class="layui-form"  method="get" target="_top">
                <input type="hidden" id="hidden" name="hidden" th:value="${comUser.userId}">
                <div class="layui-form-item">
                    <label class="layui-form-label">昵称: </label>
                    <div class="layui-input-inline">
                        <input type="text" th:value="${comUser.userPname}" id="pname" name="pname" required lay-verify="required" placeholder="请输入昵称"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">真实姓名: </label>
                    <div class="layui-input-inline">
                        <input type="text" th:value="${comUser.userName}" id="name"  name="name" required lay-verify="required" placeholder="请输入姓名"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">性别: </label>
                    <div class="layui-input-block">
                        <input type="radio" th:checked="${comUser.userSex.equals('男')}"        name="adminSex" value="男" title="男">
                        <input type="radio"  th:checked="${comUser.userSex.equals('女')}"            name="adminSex" value="女" title="女">
                    </div>
                </div>

                <!--出生日期-->
                <div class="layui-form-item">
                    <label class="layui-form-label">出生日期:</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" id="birth" name="birth"
                               th:value="${#dates.format(comUser.userBirth, 'yyyy-MM-dd')}" type="date">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">电子邮箱: </label>
                    <div class="layui-input-block">
                        <input th:value="${comUser.userEmail}"   type="text" id="adminEmail" name="adminEmail" required lay-verify="required"
                               placeholder="请输入邮箱" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">地址: </label>
                    <div class="layui-input-block">
                        <input th:value="${comUser.userHouse}" type="text" id="adminAddress" name="adminAddress" required lay-verify="required"
                               placeholder="请输入地址"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">我的签名:  </label>
                    <div class="layui-input-block">
								<textarea th:text="${comUser.userDec}"id="adminDec" name="adminDec" placeholder="请输入内容" class="layui-textarea"
                                          style="width: 60%;"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input class="layui-btn layui-btn-primary" type="button" onclick=" resigned()" value="确认修改">
                        <!--<button class="layui-btn" onclick="ac()" lay-submit lay-filter="formDemo">确认修改</button>-->
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>

    function resigned() {
        $(window.parent.$("#jianjie").html($("#adminDec").val()));
        $(window.parent.$("#pname").html($("#pname").val()));
        $.ajax({
            url: "/submitRev"
            , type: 'get'
            , async: false
            , data: {
                hidden: $("#hidden").val()
                , pname: $("#pname").val()
                , name: $("#name").val()
                , adminSex: $("input[name='adminSex']:checked").val()
                , birth: $("#birth").val()
                , adminEmail: $("#adminEmail").val()
                , adminAddress: $("#adminAddress").val()
                , adminDec: $("#adminDec").val()
            }
            , success: function (a) {
                ac()
            }
        });
    }
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
        });
    });
    function ac() {
        layui.use(['layer', 'form'], function () {
            var layer = layui.layer
                , form = layui.form;
            layer.msg('修改成功');

        });

    }
    function timeout(){
        return true;
    }
</script>


</body>
</html>
